#include <func.h>

enum args_type{
    SIGN_IN,LOGIN,SIGN_OUT,CD,LS,PUTS,GETS,REMOVE,PWD,MKDIR,RMDIR,EXIT
};

typedef struct{
    int length;
    char data[1000];
}train_t;

struct order_t{
    enum args_type order;
    char dir[1024];
    char name[1024];
}order;


void windows(int netfd,char* username,char* passwd);

int sign_in(int netfd,const char* name,const char* passwd);
int login_user(int netfd,const char* name,const char* passwd);
int sign_out(int netfd);
int cd_dir(int netfd,const char*dir);
int ls_dir(int netfd);
int puts_file(int netfd,const char* name,const char* dir);
int gets_file(int netfd,const char* name,const char* dir);
int remove_file(int netfd,const char* name,const char* dir);
int pwd(int netfd);
int mkdir_dir(int netfd,const char* name,const char* dir);
int rmdir_dir(int netfd,const char* name,const char* dir);
int exit_client(int netfd);

int recvn(int sockfd, void *buf, int length);

int lexicalanalysis(char* buf, ssize_t buflen, int netfd);
